package com.sangeng.controller;


import com.sangeng.pojo.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.List;

@RestController
@RequestMapping("/response")
public class ResponseController {


    @GetMapping("/user/{id}")
    public User testResponse(@PathVariable("id") Integer id) {
        User user = new User(id, null, null, null);
        return user;
    }


    @GetMapping("/user")
    public List<User> testResponse2() {
        List<User> list = new ArrayList<>();
        list.add(new User(1, "三更", 125, null));
        list.add(new User(1, "三更", 153, null));
        list.add(new User(1, "三更", 154, null));
        list.add(new User(1, "三更", 145, null));
        return list;
    }
}
